#!/bin/sh

#
# Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
#

# ------------------------------------------------------------------------------
# [1]	Flash Player 10 requires Mac OS X v10.4 or greater.
# 	Ensure that the current system meets that requirement.
# ------------------------------------------------------------------------------
AWKSCRIPT_BASE_PATH=`echo $0 | awk '{gsub("/MacOSXVersionCheck.sh", ""); printf($0);}'`
/usr/bin/sw_vers -productVersion | awk -f "$AWKSCRIPT_BASE_PATH/ICVersionValidator.awk"
EXECUTION_STATUS=$?

if [ $EXECUTION_STATUS -eq 0 ]
then
	# Requirement was met: return 0
	exit 0
else
	# Requirement was not met: display dialog & return error to
	# halt the installation.
	
	`osascript<<EOF
		tell application "Installer"
		set response_action to display dialog "Adobe Flash Player 10 requires Mac OS X version 10.4 or later. It cannot be installed on earlier versions of Mac OS X." buttons {"Close"} default button 1 with icon stop
		end tell
		EOF`
	exit 1
fi

#end script
